import {LoginResponse, User} from "@/types/user";

export interface AppSliceState {
    lang: string;
    changeLanguage: (v: string) => void;
    reset: () => void;
}

export interface UserSliceState {
    userInfo: User | null;
    token: string;
    channel: number;
    login: <D>(data: D) => Promise<LoginResponse>;
    getUserInfo: () => void;
    updateUserInfo: (data: User) => void;
    setToken: (t: string) => void;
    changeChannel: (v: number) => void;
    resetUser: () => void;
}

export interface SpinnerState {
    showSpinner: boolean;
    loadingDuration: number, // 加载持续时间
    loadingText: string, // 加载提示文字
    showLoading: () => void;
    hideLoading: () => void;
    resetSpinner: () => void;
}